package org.mathcloud.math.core.generic.signature;

import java.util.List;

import org.mathcloud.math.core.common.signature.OperatorObjectSignature;
import org.mathcloud.math.core.common.signature.QuantityObjectSignature;
import org.webequa.core.generic.signature.GenericObjectSignature;

public class GenericOperatorObjectSignature extends GenericObjectSignature implements OperatorObjectSignature
{
	public GenericOperatorObjectSignature()
	{
		super();
		setObjectType("OperatorObject");
		operandsNumber = 0;
		operandsSignatures = null;
		resultSignature = null;
	}
	
	public GenericOperatorObjectSignature(int operandsNumbers, 
			String mmlContentTag, String realizationName)
	{
		super();
		setObjectType("OperatorObject");
		this.operandsNumber = operandsNumbers;
		this.mmlContentTag = mmlContentTag;
		this.realizationName = realizationName;
		operandsSignatures = null;
		resultSignature = null;		
	}

	
	public List<QuantityObjectSignature> getOperandsSignatures()
	{
		return operandsSignatures;
	}

	public void setOperandsSignatures(
			List<QuantityObjectSignature> operandsSignatures)
	{
		this.operandsSignatures = operandsSignatures;
	}

	public QuantityObjectSignature getResultSignature()
	{
		return resultSignature;
	}

	public void setResultSignature(QuantityObjectSignature resultSignature)
	{
		this.resultSignature = resultSignature;
	}

	@Override
	public int getOperandsNumber()
	{
		return operandsNumber;
	}

	@Override
	public void setOperandsNumber(int operandsNumber)
	{
		this.operandsNumber = operandsNumber;
	}	

	
	@Override
	public String getMMLContentTag()
	{
		return mmlContentTag;
	}

	@Override
	public void setMMLContentTag(String mmlContentTag)
	{
		this.mmlContentTag = mmlContentTag;
	}

	@Override
	public boolean isEmptyOperator()
	{
		return (operandsNumber==0);
	}

	@Override
	public boolean isUnaryOperator()
	{
		return (operandsNumber==1);
	}

	@Override
	public boolean isBinaryOperator()
	{
		return (operandsNumber==2);
	}

	@Override
	public boolean isNaryOperator()
	{
		return (operandsNumber>=2);
	}	
	
	private String mmlContentTag;
	private int operandsNumber;
	private List<QuantityObjectSignature> operandsSignatures;
	private QuantityObjectSignature resultSignature;
}
